import 'package:flutter/material.dart';
import './tabs/tabs.dart';
import './router/router.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:provider/provider.dart';
import './provider/playAudioList.dart';
import './provider/audioProgress.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  MyApp({Key? key}) : super(key: key);

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      designSize: Size(750, 1334),
      builder: () => MultiProvider(
        providers: [
          ChangeNotifierProvider(create: (_) => PlayAudioList()),
          ChangeNotifierProvider(create: (_) => AudioProgress()),
        ],
        child: MaterialApp(
          title: "我的音乐",
          home: Tabs(),
          initialRoute: '/', //初始化的时候加载的路由
          onGenerateRoute: onGenerateRoute,
          builder: EasyLoading.init(),
        ),
      ),
    );
  }
}
